package com.java.clone.test1;

import java.util.HashMap;
import java.util.Set;

public class Test {
	public static void main(String args[]){
		HashMap<String, Object> map1 = new HashMap<String, Object>();
		map1.put("1", 1);
		map1.put("2", 2);
		map1.put("3", 3);
		new Context(map1);
		
		HashMap<String, Object> map2 = new HashMap<String, Object>();
		map2.put("1", 100);
		map2.put("2", 200);
		map2.put("3", 300);
		Context context = new Context().clone();
		HashMap<String, Object> map3 = context.getUserVars();
		System.out.println("克隆之后--未赋值 --- " + map3.get("1"));
		
		context.addUserVars(map2);
		map3 = context.getUserVars();
		System.out.println("克隆之后--赋值:");
		Set<String> keys = map3.keySet();
		for(String s : keys){
			System.out.println( s + " --- " + map3.get(s));
		}
	}
}
